package org.porridge.util;


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


public class SysUtil {
	private static final SysUtil su=new SysUtil();
	private final Properties pro=new Properties();
	
	private SysUtil(){
		
		try {
			//classLoader方式加载
			pro.load(getClass().getClassLoader().getResourceAsStream("application.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static SysUtil getInstance(){
		return su;
	}
	
	/**
	 * 获取配置参数
	 * @param key
	 * @return
	 */
	public String getProperty(String key){
		return pro.getProperty(key);
	}
}
